LocaleListCompat

Helper for accessing features in LocaleList.

Functions

Link copied to clipboard
@NonNull
open fun create(localeList: @NonNull Array<Locale>): @NonNull LocaleListCompat
Creates a new instance of LocaleListCompat from the Locale array.
Link copied to clipboard
open fun equals(other: Any): Boolean
Link copied to clipboard
@NonNull
open fun forLanguageTags(@Nullable list: @Nullable String): @NonNull LocaleListCompat
Generates a new LocaleList with the given language tags.
Link copied to clipboard
@Nullable
open fun get(index: Int): @Nullable Locale
Retrieves the Locale at the specified index.
Link copied to clipboard
@Size(min = 1)
@NonNull
open fun getAdjustedDefault(): @NonNull LocaleListCompat
Returns the default locale list, adjusted by moving the default locale to its first position.
Link copied to clipboard
@Size(min = 1)
@NonNull
open fun getDefault(): @NonNull LocaleListCompat
The result is guaranteed to include the default Locale returned by Locale.getDefault(), but not necessarily at the top of the list.
Link copied to clipboard
@NonNull
open fun getEmptyLocaleList(): @NonNull LocaleListCompat
Retrieve an empty instance of LocaleListCompat.
Link copied to clipboard
@Nullable
open fun getFirstMatch(supportedLocales: @NonNull Array<String>): @Nullable Locale
Returns the first match in the locale list given an unordered array of supported locales in BCP 47 format.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
@IntRange(from = "-1")
open fun indexOf(@Nullable locale: @Nullable Locale): Int
Searches this LocaleListCompat for the specified Locale and returns the index of the first occurrence.
Link copied to clipboard
open fun isEmpty(): Boolean
Returns whether the LocaleListCompat contains no Locale items.
Link copied to clipboard
@RequiresApi(value = 21)
open fun matchesLanguageAndScript(@NonNull supported: @NonNull Locale, @NonNull desired: @NonNull Locale): Boolean
Determine whether two locales are considered a match, even if they are not exactly equal.
Link copied to clipboard
@IntRange(from = 0)
open fun size(): Int
Returns the number of Locale items in this LocaleListCompat.
Link copied to clipboard
@NonNull
open fun toLanguageTags(): @NonNull String
Retrieves a String representation of the language tags in this list.
Link copied to clipboard
@NonNull
open fun toString(): @NonNull String
Link copied to clipboard
@Nullable
open fun unwrap(): @Nullable Any
Gets the underlying framework object.
Link copied to clipboard
@RequiresApi(value = 24)
@NonNull
open fun wrap(@NonNull localeList: @NonNull LocaleList): @NonNull LocaleListCompat
Creates a new instance of LocaleListCompat from the Locale list.
@RequiresApi(value = 24)
open fun wrap(localeList: Any): LocaleListCompat